from enum import Enum


class RiskLevelEnum(Enum):
    LEVEL_1 = 1, "非常低风险"
    LEVEL_2 = 2, "低风险"
    LEVEL_3 = 3, "中低风险"
    LEVEL_4 = 4, "中风险"
    LEVEL_5 = 5, "中高风险"
    LEVEL_6 = 6, "高风险"
    LEVEL_7 = 7, "非常高风险"
    LEVEL_8 = 8, "极高风险"
    LEVEL_9 = 9, "极度高风险"
    LEVEL_10 = 10, "灾难性风险"

    def __init__(self, value, description):
        self._value_ = value
        self.description = description

    @classmethod
    def get_description(cls, value: int) -> str:
        """根据值返回风险等级描述"""
        try:
            return cls(value).description
        except ValueError:
            return "未知风险"  # 如果风险等级无效
